package net.peelmeagrape.hibernate;

import net.peelmeagrape.hibernate.xmlgen.XmlAttribute;
import net.peelmeagrape.hibernate.xmlgen.XmlElement;
import net.peelmeagrape.hibernate.xmlgen.XmlText;

import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Used to apply a filter to a {@link H8Class} or {@link net.peelmeagrape.hibernate.collections}.
 * In order to use filters, they must first be defined (using {@link FilterDef}).
 * See <a href="{@docRoot}/reference/en/html/filters.html#filters">Hibernate Documentation for filters</a>.
 */
@Retention(RUNTIME)
@XmlElement(name="filter")
public @interface Filter
{
    @XmlAttribute String name();
    @XmlAttribute String condition() default "";
    @XmlText String value() default "";
}
